<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<div style="padding:0;" class="content tabbed">
<isperp:processProcesser processId="${model.processId }"></isperp:processProcesser>

<div class="header">
	<h3>入库信息</h3>
</div>
<table class=" form-table">
	<tr>
		<td class="td1">入库编号：</td>
		<td class="td2">${model.code }</td>
		<td class="td1">入库日期：</td>
		<td class="td2"><fmt:formatDate value="${model.instockDate}"
				pattern="yyyy-MM-dd" />
		</td>
	</tr>
	<tr>
		<td class="td1">供应商：</td>
		<td class="td2">
		  <isperp:relationLabel moduleUrl="provider/provider" idValue="${model.providerId }" displayColumn="name" id="providerId"></isperp:relationLabel>
		</td>
		
	</tr>

	<tr>
		<td class="td1">描述：</td>
		<td class="td2" colspan="3">${model.memo }</td>
	</tr>
	<tr>
		<td class="td1">填表人：</td>
		<td class="td2" colspan="3">${model.creatorName }</td>
	</tr>
	<tr>
		<td class="td1">附件：</td>
		<td class="td2" colspan="3"><isperp:uploader readonly="true"
				sourceId="${model.id }" id="sptFiles"></isperp:uploader></td>
	</tr>
</table>
<%-- <isperp:grid
	url="sparepart/sparepartChangeDetail/listDetailsBySptSparepartId?sptSparepartId=${model.id }"
	gridId="sparepartInDetailGrid" showPager="false" showSearchbar="false"
	cusDialogSize="big" cusFormatterActions="false">
	<jsp:attribute name="toolbar">
		<isperp:toolbar id="iconToolbar">
		   <div style="float:left;" class="header">
				<h3>需求清单</h3>
			</div>
		</isperp:toolbar>
		</jsp:attribute>

	<jsp:body>
		<isperp:column name="id" title="id" hidden="true"></isperp:column>
		<isperp:column name="name" title="名称" width="150">
		</isperp:column>
		<isperp:column name="specification" title="规格" width="100">
		</isperp:column>
		<isperp:column name="model" title="型号" width="100">
		</isperp:column>
		<isperp:column name="quantity" title="数量" width="120">   
		</isperp:column>
		<isperp:column name="price" title="单价" width="120">   
		</isperp:column>
		<isperp:column name="memo" title="备注" width="120">   
		</isperp:column>
	</jsp:body>
</isperp:grid> --%>

<isperp:grid
		url="sparepart/sparepartIn/listSparepartCi?sparepartId=${model.id }"
		gridId="sparepartInCiDetailGrid" showPager="true"
		showSearchbar="false" cusDialogSize="big"
		cusViewUrl="sparepart/sparepart/view"
		cusFormatterActions="true">
		<jsp:attribute name="toolbar">
		<isperp:toolbar id="iconToolbar">
		   <div style="float:left;" class="header">
					<h3>入库清单</h3>
				</div>
		</isperp:toolbar>
		</jsp:attribute>

		<jsp:body>
		<isperp:column name="id" title="id" hidden="true"></isperp:column> 
					<isperp:column name="code" title="编号" width="120">
					</isperp:column>
					<isperp:column name="devide_number" title="设备号/PN号" width="160">
					</isperp:column> 
					<isperp:column name="stock_in_date" title="入库日期" width="120" formatter="date">
					</isperp:column>
					<isperp:column name="use_staff_name" title="责任人" width="120">
					</isperp:column>
					<isperp:column name="support_staff_name" title="使用人" width="120">
					</isperp:column>
					<isperp:column name="manufacturer" title="厂商" width="120">
					</isperp:column> 
					<isperp:column name="project_name" title="项目" width="120">
					</isperp:column>
					<isperp:column name="status" title="状态" width="120">
					</isperp:column> 
	</jsp:body>
	</isperp:grid>

<div class="header">
	<h3>关联流程</h3>
</div>
<isperp:processRelation businessKey="${model.id }" readonly="true"
	processKey="sparepartInProcess"></isperp:processRelation>

</div>
<isperp:buttonList>
	<isperp:processButtons processKey="sparepartInProcess" 
		processId="${model.processId }" businessKey="${model.id }"></isperp:processButtons>
	
</isperp:buttonList>
<script type="text/javascript">
	function printSptInFlow() {
		var sptInProcessId = '${model.processId }';
		var sptInId = '${model.id}';
		//获取关联的出库单的processId
		var sptOutProcessId = "";
		$.ajax({
			url : "sparepart/sparepartRelation/getSptOutByRelateSptInId", //请求的url地址
			data : {
				sptInId : sptInId
			},
			success : function(data) {
			    sptOutProcessId=data.process_id;
				isperp.openDialog({
					contentUrl : "ReportServer?reportlet=project/spt_out_pd.cpt&op=write&id="+sptInId+"&spt_out_pid="+sptOutProcessId+"&spt_in_pid="+sptInProcessId
				})
			}
		});
	}
</script>

